package com.bigfish.gbs.service.impl;

import com.bigfish.gbs.dao.MerchantMapper;
import com.bigfish.gbs.entity.Merchant;
import com.bigfish.gbs.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("MerchantService")
public class MerchantServiceImpl implements MerchantService {


	@Autowired
	private MerchantMapper merchantMapper;

	@Override
	public int regist(Merchant merchant) {

		return merchantMapper.insert(merchant);
	}

	@Override
	public int checkMerchantname(String merchantname) {

		return merchantMapper.checkMerchantname(merchantname);
	}

	@Override
	public Merchant login(Merchant merchant) {

		return merchantMapper.login(merchant);
	}

/**	@Override
	public Merchant findById(int mid) {
//System.out.println("success");
//System.out.println("userid"+userid);
		Merchant merchant = merchantMapper.findById(mid);
		return merchant;
	}

	@Override
	public String updatemerchant(Merchant merchant){

	}
*/

	public Merchant findById(String mid) {
		return merchantMapper.findById(mid);
	}

	public void modifyMerchant(Merchant merchant){
		merchantMapper.modifyMerchant(merchant);
	}
}

